package org.hawk.gwtppc.webtest.tests.methodsuite;

import java.lang.reflect.Method;
import java.lang.reflect.TypeVariable;

import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.GenericClassMock;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock2;

public class GetGenericReturnTypeTest implements Test {

	public void run() throws Throwable {
		Asserts.assertEquals(SubClassMock2.class.getDeclaredMethod("processValue", int.class, Object.class, 
				SubClassMock2.class).getGenericReturnType(), SubClassMock2.class);
		
		Method m = GenericClassMock.class.getDeclaredMethod("getSomeValue", Object.class, Object.class, Class.class);
		Asserts.assertTrue(m.getGenericReturnType() instanceof TypeVariable);
		Asserts.assertEquals(m.getGenericReturnType().toString(), "T");
	}

	public String getName() {
		return "getGenericReturnType()";
	}

}
